import { ref as p } from "vue";
import { _ as m } from "./editRule.vue_vue_type_script_setup_true_lang.GczzKJQu.js";
import { j as d, a as s } from "./vendor.CF2kwqqq.js";
const E = (c) => {
  const i = "ValueMapper", u = {
    ports: { items: [{ id: "in", group: "left" }, { id: "out", group: "right" }] }
  }, f = {
    name: "值映射",
    type: "ValueMapper",
    fields: {
      field: []
    },
    field_to_use: "",
    target_field: "",
    non_match_default: "",
    description: [],
    distribute: "Y",
    custom_distribution: [],
    copies: "1",
    partitioning: {
      method: "none",
      schema_name: []
    },
    attributes: [],
    cluster_schema: [],
    remotesteps: {
      input: `
      `,
      output: `
      `
    },
    GUI: {
      xloc: 200,
      yloc: 100,
      draw: "Y"
    }
  }, l = p([]);
  return { name: i, step: f, markup: u, tabs: [
    {
      default: !0,
      type: "form",
      label: "属性配置",
      column: [
        {
          tag: m,
          // 基本配置
          ":formData": "formData",
          type: 4
        }
      ]
    },
    {
      type: "form",
      label: "高级配置",
      column: [
        {
          prop: "field_to_use",
          label: "使用的字段名",
          tag: d,
          cls: l
        },
        {
          label: "目标字段名(空=覆盖)",
          prop: "target_field",
          setup({ params: r }) {
            const { formData: t } = r;
            return {
              blurInput: () => {
                let a = 1;
                t.outFields.forEach((e) => {
                  e.name === t.target_field && (t.target_field = t.target_field + "_" + a, s.warning("该字段名已存在，重命名为" + t.target_field));
                }), t.fields.field.forEach((e) => {
                  e.name === t.target_field && (t.target_field = t.target_field + "_" + a, s.warning("该字段名已存在，重命名为" + t.target_field));
                });
              }
            };
          },
          "@blur": "blurInput"
        },
        { label: "不匹配时的默认值", prop: "non_match_default" }
      ]
    }
  ], open: (r, t) => {
    var e;
    const o = (e = t.form) == null ? void 0 : e.getCellFormData(r), { outFields: a } = o;
    l.value = a.map((n) => ({ label: n.name, value: n.name }));
  }, metadata: {} };
};
export {
  E as default
};
